package co.yixiang.modules.shop.repository;

import co.yixiang.modules.shop.domain.YxStorePromote;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
* @author frq
* @date 2020-08-05
*/
public interface YxStorePromoteRepository extends JpaRepository<YxStorePromote,Integer>, JpaSpecificationExecutor<YxStorePromote> {
    @Modifying
    @Query(value = "update yx_store_promote set is_del = ?1 where id = ?2", nativeQuery = true)
    void updateOnsale(Integer status, Integer id);
    @Modifying
    @Query(value = "delete from yx_store_promote_product where promote_id=?1",nativeQuery = true)
    void deletePromoteId(Integer promoteId);
}
